package first.niuke.simple;

/**
 * @ClassName NC141
 * @description:
 * @author: 荣燊
 * @create: 2021-06-13 15:30
 **/
public class NC141 {
    public static void main(String[] args) {
        String str = "absba";
        System.out.println(judge(str));
    }

    public static boolean judge (String str) {
        // write code here
        if (str.length() == 0 || str.length() == 1) {
            return true;
        }
        int i = 0;
        int j = str.length() - 1;
        while (i < j) {
            if (str.charAt(i) != str.charAt(j)) {
                return false;
            }
            ++i;
            --j;
        }
        return true;
    }
}
